package com.framework.modules.dataview.service.impl;

import com.framework.modules.dataview.entity.ViewUserDoingGroupForObjectListEntity;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.framework.common.utils.PageUtils;
import com.framework.common.utils.Query;

import com.framework.modules.dataview.dao.ViewUserDoingGroupListDao;
import com.framework.modules.dataview.entity.ViewUserDoingGroupListEntity;
import com.framework.modules.dataview.service.ViewUserDoingGroupListService;


@Service("viewUserDoingGroupListService")
public class ViewUserDoingGroupListServiceImpl extends ServiceImpl<ViewUserDoingGroupListDao, ViewUserDoingGroupListEntity> implements ViewUserDoingGroupListService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        EntityWrapper wrapper=new EntityWrapper<ViewUserDoingGroupListEntity>();
        if(params.containsKey("uid")){
            wrapper.eq("uid",params.get("uid"));
        }
        if(params.containsKey("object_id")){
            wrapper.eq("object_id",params.get("object_id")).ne("uid",params.get("object_id"));
        }
        if(params.containsKey("type")){
            wrapper.eq("type",params.get("type"));
        }
        Page<ViewUserDoingGroupListEntity> page = this.selectPage(
                new Query<ViewUserDoingGroupListEntity>(params).getPage(),
                wrapper
        );

        return new PageUtils(page);
    }

}
